<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <%@include file="/WEB-INF/jspf/meta/meta.jspf"%>
    <title>课程表主体</title>
    <%@include file="/WEB-INF/jspf/adminPage.jspf"%>
    <%@include file="/WEB-INF/jspf/css_js/easyui_grid_tools_js.jspf"%>
	<script type="text/javascript" src="<%=request.getContextPath() %>/static/_condition/list.js"></script>
	
<script>
	$(function() {
		for (var i = 0; i < 20; i++) {
			$('#dg_common_condition').datagrid('insertRow', {
				index : 1,
				row : {}
			})
		}
	});
	//调用父页面的接口 入口函数
	function f_fatherFunctionName(){
		var data=getJsonByBody();
		<%
			String fatherFunctionName=request.getAttribute("fatherFunctionName").toString();
			out.print("window.parent."+fatherFunctionName+"(data);");//调用父页面的接口 
		%>
		f_closeCondition();
	}
	//页面交互区
	function f_closeCondition() {
	    window.parent.f_common_closeCondition();
	}
	// 这个是条件的 js集合  如：  var conditionData=[];  的形式。由后台根据参数生成。
	${conditionData}
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'west',split:true" style="width:250px;">
            <div id="divID_Tree_menu" class="ztree">查询方案列表</div>
        </div>
        <div data-options="region:'center'" id='centerMain'>
            <table id="dg_common_condition" class="easyui-datagrid" fit='true'
                   data-options="
                   rownumbers:true,
                   singleSelect: true,
                   toolbar:'#tb_common_condition',
                   method:'post',
                   onClickCell: onClickCell
                   ">
                <thead>
                    <tr>                
                        <th data-options="field:'parentheses',width:90,editor:'text'"><div>括号区</div></th>
                        <th data-options="field:'andOr',width:90,editor:{type:'combobox',options:{
                            data:_common_andOr
                            ,editable:false
                            ,width:200
                            }
                            }"><div>接连符</div></th>
                            
                        <th data-options="field:'conditionName',width:150,editor:{type:'combobox',options:{
                            data:conditionData
                            ,editable:false
                            ,width:300
                            }
                            }"><div>条件名</div></th>
                        <th data-options="field:'operator',width:100,editor:{type:'combobox',options:{
                            data:_common_operator
                            ,editable:false
                            ,width:300
                            }
                            }"><div>判断区</div></th>
                        <th data-options="field:'conditionValue',width:190,editor:'text'"><div>条件值</div></th>
                    </tr>
                </thead>
            </table>
            <div id="tb_common_condition" style="padding:2px 5px;">
                <div>
                    <a href="javascript:void(0)"iconCls="icon-remove" class="easyui-linkbutton" plain="true" onclick="dellRowServlet()">删除方案</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="submitFormID" plain="true"onclick="submitForm('submitFormID', false)">新增方案</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" id="submitFormIDU" plain="true"onclick="submitForm('submitFormIDU', true)">修改方案</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" onclick="f_closeCondition()">关闭条件框</a>
                </div>
                <div>
                    <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" onclick="MoveUp()">上移</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" onclick="MoveDown()">下移</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" onclick="dellRow()">移除行</a>
                    <a href="javascript:void(0)" class="easyui-linkbutton" plain="true" onclick="addRow()">添加行</a>
					<a href="javascript:void(0)" class="easyui-linkbutton" onclick="f_fatherFunctionName()">执行查询</a>                    
                </div>
                <div>
                	<form action="" id="form_condition">
                    <table>
                        <tr>
                            <td>条件方案名称</td>
                            <td>
                                <input type="text"  id="programme_name" name="programme_name" data-options="required:false" class="easyui-textbox"/>
                                <input type="hidden"  id="programme_name_id"/>
                            </td>
                        </tr>
                    </table>
                    </form>
                </div>
            </div>
        </div>
</body>
</html>
